/**
 * @Author: Sagan
 * @Date: 2020/09/17 17:16
 */
package module

import (
	"gitee.com/big_meteor/godash/lang"
	"gitee.com/big_meteor/godash/validate/constant"
	"gitee.com/big_meteor/godash/validate/function"
	"reflect"
)

// 最大长度
// 支持的类型：string
func Max(v interface{}, num int) (bool, error) {
	var rt reflect.Kind
	v, rt = lang.GetValue(v)

	if reflect.String != rt {
		return false, constant.ERROR_MAX_UDT
	}

	return function.Max(v.(string), num), nil
}
